Attribute VB_Name = "mdlResources"
Option Explicit

Public Declare Function LoadStringTable Lib "Fonts.dll" (ByVal lpID As Long) As String

Public Const strFontDLL = "Fonts.dll"
Public Const strConstants = "Constants.ini"
Public Const strPlugins = "Plugins.ini"
Public Const strContributorsPath = "Contributors.txt"

Public Function LoadGlobalLanguage(ByVal lpID As Long) As String
    On Error Resume Next
    If IsFileOrDirectoryExist(IntoPath(strBase, strFontDLL)) = True Then
        LoadGlobalLanguage = LoadStringTable(lpID)
    Else
        LoadGlobalLanguage = LoadResString(lpID)
    End If
End Function

Public Function GetConstantDeclare(ByVal strVar As String, ByRef ptReturn As Double) As Boolean
    On Error Resume Next
    Dim strGet As String
    Const strApplication = "Constants"
    strGet = GetKeyCodeFromLog(strApplication, Trim(strVar), vbNullString, IntoPath(strBase, strConstants))
    If Trim(strGet) = vbNullString Then
        GetConstantDeclare = False
        Exit Function
    Else
        If IsNumeric(strGet) = True Then
            ptReturn = Val(strGet)
        Else
            ptReturn = 0
        End If
        GetConstantDeclare = True
    End If
End Function

Public Function LoadNumberSetup(ByVal strApplication As String, ByVal strPath As String, ByVal strKey As String, ByVal lpDefault As Double) As Double
    On Error Resume Next
    Dim strRead As String
    strRead = GetSetting(strApplication, strPath, strKey, Trim(Str(lpDefault)))
    If IsNumeric(strRead) = False Or Trim(strRead) = vbNullString Then
        strRead = Trim(Str(lpDefault))
    End If
    LoadNumberSetup = Val(strRead)
End Function
